import Vue from 'vue'
import App from './App'

Vue.prototype.getback = function(){
    uni.navigateBack({
        delta: 1,
    });
}
Vue.prototype.$post = function (url) {
	return new Promise(function (resolve, reject) {
		uni.request({
			url:'https://invest.sayyin.com/'+url,
			data:{},
			method:"POST",
			success : (res) => {
				resolve(res.data)
			},
			fail: (err) => {
				
			}
		})
	})
}
// 跳转页面
Vue.prototype.getnav = function(url){
    uni.navigateTo({
        url: url,
    });
}

//关闭子页面跳转
Vue.prototype.redirectTo = function(url){
	uni.redirectTo({
        url: url,
    });
}

//tabbar跳转
Vue.prototype.switchTab = function(url){
	uni.switchTab({
		url:url
	})
}

import uniLoadMore from 'customComponents/uni-load-more.vue'
import Header from 'customComponents/publicTitle.vue'
import router from 'router/router.js'
import http from 'api/api.js'
Vue.component('uniLoadMore',uniLoadMore)
Vue.component('Header',Header)
Vue.prototype.router = router;
Vue.prototype.http = http;
Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
	...App
})
app.$mount()
